Repository navigation
fork: list and remind delegated results that never reached the parent (#386 part 2) - #622
Merged
Merged
Conversation
…#386 part 2) task_list (read only) lists a thread's delegate_task tasks whose result is owed (pending or claimed), unrecorded (no delivery state, from before it was kept) or, on request, settled, local and remote alike, and counts its running children per place from their live status: local thread shells, remote runStatus with a 5 s limit (no answer = unknown, never live). checkLinked asks each linked environment for threads that name this thread as their parent but that no task follows (a launch whose record never ran). The delegated result reminder is a backstop for upstream's completion wake. A parent's own events (a task ending owed, a run ending while it was watched) start one check per parent after two minutes, debounced; at start the parents upstream re-offers wakes to are checked once. An idle parent with results still owed and ended in the last day gets one queued message through the waits' at-most-once send, with ids derived from the owed task ids, so a rerun or a restart never sends it twice. Busy, stopped, archived and deleted parents, rows with no delivery state and provider-native subagents are skipped. Off while server.waitFor is off. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Owner
Author
Review (one lens: state, delivery and spam, fork fit) at
|
scuttletoby
added a commit
that referenced
this pull request
Nov 21, 2026
…#386 part 2) (#622) * fork: list and remind delegated results that never reached the parent (#386 part 2) task_list (read only) lists a thread's delegate_task tasks whose result is owed (pending or claimed), unrecorded (no delivery state, from before it was kept) or, on request, settled, local and remote alike, and counts its running children per place from their live status: local thread shells, remote runStatus with a 5 s limit (no answer = unknown, never live). checkLinked asks each linked environment for threads that name this thread as their parent but that no task follows (a launch whose record never ran). The delegated result reminder is a backstop for upstream's completion wake. A parent's own events (a task ending owed, a run ending while it was watched) start one check per parent after two minutes, debounced; at start the parents upstream re-offers wakes to are checked once. An idle parent with results still owed and ended in the last day gets one queued message through the waits' at-most-once send, with ids derived from the owed task ids, so a rerun or a restart never sends it twice. Busy, stopped, archived and deleted parents, rows with no delivery state and provider-native subagents are skipped. Off while server.waitFor is off. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * FORK_CHANGES: delegated results reminder and task_list (#386) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
scuttletoby
added a commit
that referenced
this pull request
Nov 21, 2026
…#386 part 2) (#622) * fork: list and remind delegated results that never reached the parent (#386 part 2) task_list (read only) lists a thread's delegate_task tasks whose result is owed (pending or claimed), unrecorded (no delivery state, from before it was kept) or, on request, settled, local and remote alike, and counts its running children per place from their live status: local thread shells, remote runStatus with a 5 s limit (no answer = unknown, never live). checkLinked asks each linked environment for threads that name this thread as their parent but that no task follows (a launch whose record never ran). The delegated result reminder is a backstop for upstream's completion wake. A parent's own events (a task ending owed, a run ending while it was watched) start one check per parent after two minutes, debounced; at start the parents upstream re-offers wakes to are checked once. An idle parent with results still owed and ended in the last day gets one queued message through the waits' at-most-once send, with ids derived from the owed task ids, so a rerun or a restart never sends it twice. Busy, stopped, archived and deleted parents, rows with no delivery state and provider-native subagents are skipped. Off while server.waitFor is off. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * FORK_CHANGES: delegated results reminder and task_list (#386) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of #386
What
Part 2 of #386: no delegated child's result can sit unseen.
task_listis a new read-only MCP tool beside the wait tools. It lists the calling thread'sdelegate_tasktasks, local and remote, and sorts them into three groups:pendingorclaimed.includeSettled.It also reports the slots: how many children run now in each place, taken from their live status, not the parent's notes.
isLiveSubagentShell. Local children of settled tasks that were sent more work are counted too.RemoteDelegation.runStatus, limited to 5 s. No answer counts asunknown, never as live.checkLinked: truealso asks each linked environment for threads whosedelegatedFromnames this thread but that no task here follows. Those are launches whose record never ran. Listing never marks a result read;task_statusstill does that.The delegated result reminder is a backstop for upstream's own completion wake (
fork/delegatedResults/DelegatedResultReminder.ts).getRecoveryThreadIds("delegated-completions")) are checked once.task_status.server.waitForis off, so a machine that never sets a fork setting behaves like upstream.Item 1 (the lost completion's root cause): already settled by part 1
The research note on the lost report found the cause: the parent's
delegate_taskcall was interrupted after the launch over there and before the task was recorded here. So no task existed to follow, and no wake could ever fire.fork/remoteDelegationAbortSafe.test.ts: "a delegate call interrupted before its launch there launches and records nothing", "an uninterrupted delegate call launches, records and follows once", and "a recorded launch with no task here to follow is stopped there, with a warning".task_listwithcheckLinkedreports it as an orphan.Why this hook
I chose the least intrusive hook that fits upstream:
streamDomainEvents), checked after a delay so that upstream's wake goes first.WaitDelivery: message check, then receipt check, then send). The message and command ids come from the sorted owed task ids, so the dedupe holds across reruns and restarts and needs no new table.State question (each answered by a test)
unknownafter 5 s and are never counted as live slots. WithcheckLinkedit is listed underunreachable.unrecorded. Results older than 24 h, provider-native subagents and an empty thread give nothing.Tests
apps/server:vp test run src/fork/delegatedResults src/mcp/toolkits/waits src/provider/ForkAgentContextBudget.test.ts→ 53 passed.effect-tsgo tsrs --noEmitis clean, andvp lintandvp fmtare clean.Red on the old code: on
mainthe new suites fail, becausetask_listand the reminder do not exist. To check that the tests catch real bugs, I made three deliberate mutations to the new code:waitForgate;Each made the tests fail (6 tests in total), and all passed again after the code was restored.
Adding the tool raises the fork's tool-list budget,
forkAgentContextBudget.json, from 1979 to 2451 bytes. Thewait_*description test still checks only the wait tools.General vs project
Everything here is general: any T3 user who delegates tasks gets it. Nothing in it is project-specific, and there are no project facts or config.
Fork fit
fork/delegatedResults/andmcp/toolkits/waits/. It is wired throughfork/forkLayers.ts.fork-seam-check.cjspasses).completionDelivery,omitSettledSubagents,isLiveSubagentShell,getRecoveryThreadIds,RemoteDelegation.runStatus, and thet3_thread_listdelegatedFromfield.🤖 Generated with Claude Code